<template>
  <div>
  <div id="ho_header">      
                <h1>{{ho_name}}</h1>
        </div>
  </div>
</template>

<script>
export default {
        name: 'ho_header',
        data() {
            return {
                ho_name: "",
            }
        },
        methods: {
            loadHomeworkData() {
               
                     this.axios
                     .get("http://10.197.43.62:8088/student/allhomework_cl?cl_id=" + this.cl_id+"&st_id="+this.st_id)
                    .then((res) => {
                        for (let i=0; i <res.data.length; i++) {
                            if (res.data[i].ho_id == this.ho_id) {
                                this.ho_name = res.data[i].ho_name
                            }
                        }
                    });
            },
          
        },
        mounted() {
            this.loadHomeworkData();
        },
        computed: {
              cl_id() {
                return this.$store.state.cl_id;
            },
            ho_id() {
                return this.$store.state.ho_id;
            },
             st_id() {
      return this.$store.state.st_id;
    },
        }
    }
</script>

<style scoped>
    #ho_header h1 {
        text-align: center; 
        font-size: 30px;
    }
</style>
